class TicketsController < CRUDController

  before_filter :login_required, :except => [:index]

  def index
    @tickets = Ticket.find_all_by_status_id(1)
  end

  def update
    @ticket = Ticket.find(params[:id])
    @ticket_change =  @ticket.change(params[:ticket], params[:ticket_change])
    redirect_to ticket_path(@ticket)
  end

  def message
    { :created =>  "Ticket has been created successful",
      :failed_to_create =>  "Failed to create ticket"
    }
  end



end
